<%--
  User: naim
  Date: Dec 23, 2009
--%>

<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib prefix="c" uri="/c.tld" %>
<html>
<head>
    <title>DSE ALERT!</title>
    <link href="<c:url value='/css/common.css'/>" rel="stylesheet" type="text/css">

</head>
<body>


<div id="container">
<%@include file="/header.jsp"%>

    <div id="page-header">
        <c:choose>
            <%--@elvariable id="type" type="java.lang.String"--%>
            <c:when test="${type == 'pending'}">
                Pending List
            </c:when>
            <c:otherwise>
                Approved List
            </c:otherwise>
        </c:choose>
    </div>

    <span style="float:right">
        <c:choose>
            <%--@elvariable id="type" type="java.lang.String"--%>
            <c:when test="${type == 'pending'}">
                <a href="<c:url value='/req/approved'/>"> (show Approved List) </a>
            </c:when>
            <c:otherwise>
                <a href="<c:url value='/req/pending'/>"> (show Pending List) </a>
            </c:otherwise>
        </c:choose>
    </span>

    <br/>

    <c:choose>
        <%--@elvariable id="list" type="java.util.List"--%>
        <c:when test="${empty list}">
            <div class="msg">
                No Pending Requests!
            </div>
        </c:when>
        <c:otherwise>
            <form method="post">
                <table width="100%">
                    <thead>
                        <tr>
                            <th>Email</th>
                            <th>Request Date</th>
                            <th>
                                <c:choose>
                                    <%--@elvariable id="type" type="java.lang.String"--%>
                                    <c:when test="${type == 'pending'}">
                                        Allow Access
                                    </c:when>
                                    <c:otherwise>
                                        Deny Access
                                    </c:otherwise>
                                </c:choose>
                            </th>
                        </tr>
                    </thead>
                    <tbody>
                        <c:forEach var="ua" items="${list}">
                            <tr>
                                <td class="data"><c:out value="${ua.email}"/></td>
                                <td class="data"><c:out value="${ua.date}"/></td>
                                <td class="data"><input type="checkbox" name="emails" value="${ua.email}"/></td>
                            </tr>
                        </c:forEach>

                        <tr>
                            <td colspan="3" class="button">
                                <input type="submit" name="submitButton" value="Save"/>
                            </td>
                        </tr>
                    </tbody>
                </table>
            </form>
        </c:otherwise>
    </c:choose>
<%@ include file="/footer.jsp"%>
</div>
</body>
</html>